package LinkedHashSet;
import java.util.LinkedHashSet;
import java.util.Set;

/**
 * @Author 小闽
 * @Date 2024/11/12 17:06
 * @PackageName: LinkedHashSet
 * @ClassName: LinkedHashSetSource
 * @Description:
 * @Version
 */
@SuppressWarnings({"all"})
public class LinkedHashSetSource {
    public static void main(String[] args) {
        Set set = new LinkedHashSet();
        set.add(new String("AA"));
        set.add(456);
        set.add(456);
        set.add(new Customer("刘",1001));
        set.add(123);
        set.add("苏宁易购");

        System.out.println("LinkedHashSet=" + set);
    }
}
class Customer{
    private String name;
    private int no;

    public Customer(String name, int no) {
        this.name = name;
        this.no = no;
    }

    @Override
    public String toString() {
        return "Customer{" +
                "name='" + name + '\'' +
                ", no=" + no +
                '}';
    }
}